package com.romaremez.testuser.src.testsystem;

//import com.romaremez.testuser.src.admin.Admin;
import com.romaremez.testuser.src.userdata.*;
import com.romaremez.testuser.src.datautils.DataSaver;

/**
 * Main application class, which starts the test
 *
 * @version 1.667
 * @author Roman Remez & Max Karasik
 */
public class TestStarter {

    public static void main(String[] args) {
         new TestStarter().start();
    }

    private void start() {
        DataBase dataBase = new DataBase();
        User user = dataBase.getUser();
        if (user.isAdmin()) {
            dataBase.displayUsersAndSessions();
        } else{
            UserSession userSession = dataBase.getSession(user);
            new TestUser(userSession).startTest();
            dataBase.save();
        }
    }

}
